import request from "@/utils/request";

export const GetTeachingClassByPage = (pageNum, pageSize, queryDto) => {
    return request({
        url: "/admin/educational/teachingClass/getTeachingClassByPage/" + pageNum + '/' + pageSize,
        method: 'get',
        params: queryDto,
    })
}

export const UpdateTeachingClass = teachingClass => {
    return request({
        url: "/admin/educational/teachingClass/updateTeachingClass",
        method: 'put',
        data: teachingClass,
    })
}

export const SaveTeachingClass = data => {
    return request({
        url: "/admin/educational/teachingClass/saveTeachingClass",
        method: 'post',
        data: data,
    })
}

export const DeleteTeachingClassById = teachingClassId => {
    return request({
        url: "/admin/educational/teachingClass/deleteById/" + teachingClassId,
        method: 'delete',
    })
}

export const SaveStudentToTeachingClassByClassesId = (teachingClassId, classesId) => {
    return request({
        url: "/admin/educational/teachingClass/saveStudentToTeachingClassByClassesId/" + teachingClassId + '/' + classesId,
        method: 'post'
    })
}

export const FindAllClassByTeachingClass = (courseId, academicYear, semester) => {
    return request({
        url: `/admin/educational/teachingClass/findAllClassByTeachingClass/${courseId}/${academicYear}/${semester}`,
        method: 'get',
    })
}

export const GetElectiveCourseListByPage = (pageNum, pageSize, ownership) => {
    return request({
        url: '/admin/educational/teachingClass/getElectiveCourseListByPage/' + pageNum + '/' + pageSize,
        method: 'get',
        params: ownership,
    })
}
//选课
export const StudentsCourseSelection = (teachingClassId, studentNumber) => {
    return request({
        url: '/admin/educational/teachingClass/studentsCourseSelection/' + teachingClassId + '/' + studentNumber,
        method: 'post',
    })
}
//退课
export const StudentsCourseDelete = (teachingClassId, studentNumber) => {
    return request({
        url: '/admin/educational/teachingClass/studentsCourseDelete/' + teachingClassId + '/' + studentNumber,
        method: 'delete',
    })
}
export const GetElectiveCourseByStudentNumber = (studentNumber) => {
    return request({
        url: '/admin/educational/teachingClass/getElectiveCourse/' + studentNumber,
        method: 'get',
    })
}